<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<title>字典中心</title>
<head th:replace="system/inc/incHead :: incHead"></head>
<link rel="stylesheet" href="/static/hplus/js/plugins/codemirror-5.31.0/lib/codemirror.css"/>
<link rel="stylesheet" href="/static/hplus/js/plugins/codemirror-5.31.0/theme/dracula.css"/>
<link rel="stylesheet" href="/static/hplus/js/plugins/codemirror-5.31.0/addon/fold/foldgutter.css"/>
<body class="gray-bg">
<div class="wrapper wrapper-content no-padding no-margins">
    <div class="row no-padding no-margins">
        <div class="col-sm-3 no-padding no-margins">
            <div class="ibox no-padding no-margins">
                <div class="ibox-content p-xxs no-margins">
                    <div class="row no-padding no-margins">
                        <div class="form-group col-md-12 no-padding no-margins">
                            <div class="input-group no-padding no-margins">
                                <span class="input-group-addon">检索条件:</span>
                                <input id="sv" name="sv" type="text" class="form-control input-sm" th:value="${sv}">
                                <div class="input-group-btn" id="GroupsSearch">
                                    <button type="button" class="btn btn-sm btn-white dropdown-toggle" data-toggle="dropdown">
                                        <span class="fa fa-search"></span>
                                    </button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div th:unless="${#lists.isEmpty(groups)}" class="ibox-content m-t-xs">
                    <div class="file-manager">
                        <h5>模板组信息</h5>
                        <div class="hr-line-dashed"></div>
                        <ul class="folder-list" style="padding: 0" layoutH="128">
                            <li th:each="item:${groups}" class="p-xxs">
                                <a th:if="${parent.id == item.id}" href="javascript:;"><i class="fa fa-cube"></i>
                                    <selection class="text-info">[[${item.id}]]:【[[${item.groupName}]]】</selection>
                                </a>
                                <a th:if="${parent.id != item.id}" th:href="|/template?gId=${item.id}&sv=${sv}|">
                                    <i class="fa fa-cube"></i>[[${item.id}]]:【[[${item.groupName}]]】
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-9 no-padding no-margins">
            <div class="row no-padding no-margins">
                <div class="col-sm-12 no-margins">
                    <div class="ibox no-padding no-margins">
                        <div class="ibox-title">
                            <div th:if="${@lj.limit('BizTemplateGroupAdd')>0}" class="btn btn-sm btn-info" ljUrl="/biz/template/group/add" title="模板组表新增" target="ljOpenCon" ljWidth="600px"
                                 ljHeight="650px">
                                <i class="fa fa-paste">添加模板组</i>
                            </div>
                            <div th:if="${@lj.limit('BizTemplateGroupEdit')>0}" class="btn btn-sm btn-info" th:ljUrl="|/biz/template/group/edit?id=${parent?.id}|" title="编辑模板组" target="ljOpenCon"
                                 ljWidth="600px" ljHeight="650px">
                                <i class="fa fa-paste">编辑模板组</i>
                            </div>
                            <div th:if="${@lj.limit('BizTemplateGroupDel')>0}" class="btn btn-sm btn-danger" th:ljUrl="|/biz/template/group/del?id=${parent?.id}|" title="删除模板组" target="ljAjaxTodo">
                                <i class="fa fa-paste">删除模板组</i>
                            </div>
                            <div class="btn btn-sm btn-info m-l" th:ljUrl="|/template/add?gId=${parent?.id}|" title="新增模板" target="ljOpenCon">
                                <i class="fa fa-paste">新增模板配置</i>
                            </div>
                            <div class="btn btn-white btn-bitbucket btn-sm pull-right btnPageRefresh"><i class="fa fa-refresh">页面刷新</i></div>
                        </div>
                        <div class="ibox-content ljScrollbar3" style="padding:10px;" layoutH="70">
                            <table class="table table-striped table-bordered table-hover table-responsive lj-table-nowrap">
                                <thead>
                                <tr>
                                    <th style="min-width:60px;" class="text-center">编号</th>
                                    <th style="min-width:100px;">模板名称</th>
                                    <th style="min-width:200px;max-width:250px;">目录名称</th>
                                    <th style="min-width:100px;max-width:250px;">文件名称</th>
                                    <th style="min-width:80px;max-width:250px;">模板内容</th>
                                    <th style="min-width:150px;">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr th:each="item:${templateConfigs}" class="warning">
                                    <td style="min-width:60px;" class="text-center">[[${item.id}]]</td>
                                    <td style="min-width:100px;" th:text="${item.name}"></td>
                                    <td style="min-width:200px;max-width:250px;" th:text="${item.folder}"></td>
                                    <td style="min-width:100px;max-width:250px;" th:text="${item.fileName}"></td>
                                    <td style="min-width:80px;max-width:250px;" th:text="${item.content}"></td>
                                    <td style="min-width:150px;" class="p-xxs">
                                        <button th:if="${@lj.limit('BizTemplateConfigEdit')>0}" class="btn btn-xs btn-success" th:ljUrl="|/biz/template/config/edit?id=${item.id}|" title="编辑模板"
                                                target="ljOpenCon">
                                            <i class="fa fa-paste">编辑模板</i>
                                        </button>
                                        <button th:if="${@lj.limit('BizTemplateConfigDel')>0}" class="btn btn-xs btn-danger" th:ljUrl="|/biz/template/config/del?id=${item.id}|" title="删除模板"
                                                target="ljAjaxTodo">
                                            <i class="fa fa-paste">删除模板</i>
                                        </button>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:replace="system/inc/incBottom :: incBottom"></div>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/lib/codemirror.js"></script>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/clike.js"></script>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/addon/fold/foldcode.js"></script>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/addon/fold/foldgutter.js"></script>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/addon/fold/brace-fold.js"></script>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/addon/fold/comment-fold.js"></script>
<script src="/static/hplus/js/plugins/codemirror-5.31.0/addon/edit/matchbrackets.js"></script>
<script type="text/javascript" th:inline="javascript">
    /*<![CDATA[*/
    jQuery(function ($) {
        $("#sv").focus();
        $("#GroupsSearch").on("click", function () {
            var sv = $("#sv").val();
            window.location.href = "/template?gid=[[${parent?.id}]]&sv=" + sv;
        });
        $('#sv').on('keypress', function (event) {
            if (event.keyCode == 13) {
                var sv = $("#sv").val();
                window.location.href = "/template?gid=[[${parent?.id}]]&sv=" + sv;
            }
        });
    });
    /*]]>*/
</script>
</body>
</html>